﻿using System.Globalization;
using System.Windows.Data;
using System.Windows.Media;

namespace XYAC.Framework.MonitorTireMaterialOnline.Converters
{
    public class LocalSyncStateForeColorConverter : IValueConverter
    {
        public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
        {
            if (value is int syncState)
            {
                return syncState switch
                {
                    1 => Brushes.Red,
                    -1 => Brushes.Green,
                    _ => Brushes.Black,  // 默认颜色
                };
            }
            return Brushes.Black; // 默认颜色
        }

        public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
